<!DOCTYPE html>
{% load sekizai_tags i18n configuration theme_pipeline optional_include static %}
<html lang="{{LANGUAGE_CODE}}">
<head>
  <meta charset="UTF-8">
  <title>{% block title %}{{ platform_name }}{% endblock %}</title>

  <link rel="icon" type="image/x-icon" href="{% favicon_path %}" />

  {% with "js/i18n/"|add:LANGUAGE_CODE|add:"/djangojs.js" as i18njs_path %}
    <script type="text/javascript" src="{% static i18njs_path %}"></script>
  {% endwith %}

  {% stylesheet 'style-vendor' %}
  {% stylesheet 'style-main-v1' %}

  {% block main_vendor_js %}
  {% javascript 'main_vendor' %}
  {% endblock %}
  {% block headextra %}{% endblock %}
  {% render_block "css" %}

  {% if request.course and request.render_course_wide_assets %}
  {% for css in request.course.course_wide_css %}
  <link rel="stylesheet" href="{{css}}" type="text/css">
  {% endfor %}
  {% endif %}

  {% optional_include "head-extra.html"|microsite_template_path %}

  {% google_analytics_4_id as ga_4_id %}
  {% if ga_4_id %}
    <script async src="https://www.googletagmanager.com/gtag/js?id={{ ga_4_id }}"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', '{{ ga_4_id }}');
    </script>
  {% endif %}

  <meta name="path_prefix" content="{{EDX_ROOT_URL}}">
</head>

<body class="{% block bodyclass %}{% endblock %} lang_{{LANGUAGE_CODE}}">
    {% load render_bundle from webpack_loader %}
    {% render_bundle "commons" %}
  <div class="window-wrap" dir="{{LANGUAGE_BIDI|yesno:'rtl,ltr'}}">
    <a class="nav-skip" href="#main">{% trans "Skip to main content" as tmsg %} | {{ tmsg | force_escape }}</a>
    {% with course=request.course %}
      {% include "header.html"|microsite_template_path with online_help_token=online_help_token  %}
    {% endwith %}
    <div class="content-wrapper" id="content">
      {% block body %}{% endblock %}
      {% block bodyextra %}{% endblock %}
    </div>
    {% with course=request.course %}
      {% include "footer.html"|microsite_template_path %}
    {% endwith %}

  </div>

    {% javascript 'base_application' %}

    {% render_block "js" %}

    {% if request.course and request.render_course_wide_assets %}
    {% for js in request.course.course_wide_js %}
    <script type="text/javascript" src="{{js}}"></script>
    {% endfor %}
    {% endif %}
</body>
</html>

{% comment %}
  This is a django template version of our main page from which all
  other pages inherit. This file should be rewritten to reflect any
  changes in main.html! Files used by {% include %} can be written
  as mako templates.

  Inheriting from this file allows us to include apps that use the
  django templating system without rewriting all of their views in
  mako.
{% endcomment %}
